#ifndef __WOE_SERVICE_IMP_LGC___
#define __WOE_SERVICE_IMP_LGC___

#include "Service/ServiceImp.h"
#include "ServiceDataSMS.h"
#include "Entity/EntityManagerIf.h"
#include "Entity/EntityBuilderIf.h"
#include "Scene/SceneManagerIf.h"
#include "Message/MsgHandlerIf.h"
#include "Manager/DataManagerIf.h"
#include "Player/PlayerData.h"

//
//	Logic Service
//
//
class ServiceImpLgc : public ServiceImp
{
public:
	ServiceImpLgc();
	~ServiceImpLgc();

	virtual void init(ServiceData& data);

	//
	//	init message handler map
	//
	void initMsgHandler();

protected:
	virtual void onStart();
	virtual void onStop();
	//
	//	callbacks
	//
	virtual void onTimer();
	virtual void onDispatchMsg(IMsg* pMsg);

public:
	//
	//	get m_wpSvcDB
	Service* getSvcDB() const;

	//
	//	get m_wpSvcHost
	Service* getSvcHost() const;

protected:
	//
	//	set message handler for current module
	//
	void setMsgHandler(int msgCate, IMsgHandler* pHandler);


protected:
	Service*	m_wpSvcDB;
	Service*	m_wpSvcHost;


	//
	//	manager for player entity after player step into the real world
	//	key: player session id
	//	value: player entity
	//
	IEntityManager*		m_pEttMgrWorld;

	//
	//	manager for player that still in login stage
	//	key: session id
	//	value: login entity
	IEntityManager*		m_pEttMgrLogin;

	//
	//	Global scene manager
	//	all active scene should be managed here
	ISceneManager*		m_pScnMgr;

	//
	//	MessageHandler
	//
	IMsgHandler*		m_pMsgHandler;

	//
	//
	IDataManager*		m_pScnDataMgr;

	//
	//
	PlayerDataManager	m_playerDataMgr;
};

#endif

